export function openLocation(res) {
	// #ifdef MP-WEIXIN
	wx.openLocation({
		latitude: parseFloat(res.latitude), //,latitude,
		longitude: parseFloat(res.longitude), //longitude,
		name: res.name, //定位名称
		address: res.detail, //具体地址
		scale: 15
	})
	// #endif
}

export function scan() {
	return new Promise((resolve, reject) => {
		wx.scanCode({
			success: (res) => {
				console.log("扫码结果", res.result);
				resolve(res.result)
			},
			fail: (res) => {
				console.log(res);
				reject(res)
			}
		})
	})

}

export function isWeixin() {
	return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1;
}
